package com.ssy.lingxi.pay.entity.eAccount;

import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * e账户交易记录
 * @author jw.chen
 * @version 2.0.0
 * @date 2021/12/08
 */
@Data
@Entity
@Table(schema = "public", name = "pay_e_account_trade_record", indexes = {
        @Index(name = "pay_e_account_trade_record_trade_time_idx", columnList = "tradeTime"),
        @Index(name = "pay_e_account_trade_record_operation_idx", columnList = "operation"),
        @Index(name = "pay_e_account_trade_record_trade_code_idx", columnList = "tradeCode")})
public class EAccountTradeRecord implements Serializable {
    private static final long serialVersionUID = 6140737042006123330L;

    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="e_account_trade_record_seq")
    @SequenceGenerator(sequenceName="pay_e_account_trade_record_seq", name="e_account_trade_record_seq",allocationSize = 1)
    private Long id;

    /**
     * 交易流水号
     */
    @Column(columnDefinition = "varchar(32)", nullable = false)
    private String tradeCode;

    /**
     * 通联支付单号
     */
    @Column(columnDefinition = "varchar(32)")
    private String orderCode;

    /**
     * 交易时间
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long tradeTime;

    /**
     * 交易金额
     */
    @Column(columnDefinition = "decimal", nullable = false)
    private BigDecimal tradeMoney;

    /**
     * 交易项目: 1-账户充值, 2-账户提现, 3-订单支付, 4-订单退款, 5-订单返利
     */
    @Column(columnDefinition = "int", nullable = false)
    private Integer operation;

    /**
     * 状态: 1-申请提现, 2-审核通过, 3-审核不通过, 4-提现成功, 5-提现失败, 6-支付中, 7-支付失败, 8-确认到账, 9-支付成功
     */
    @Column(columnDefinition = "int", nullable = false)
    private Integer status;

    /**
     * 银行账号(提现)
     */
    @Column(columnDefinition = "varchar(50)")
    private String bankCardNo;

    /**
     * 备注
     */
    @Column(columnDefinition = "varchar(200)")
    private String remark;

    /**
     * 会员id
     */
    @Column(columnDefinition = "int8")
    private Long memberId;

    /**
     * 会员名称
     */
    @Column(columnDefinition = "varchar(60)")
    private String memberName;

    /**
     * 会员角色id
     */
    @Column(columnDefinition = "int8")
    private Long memberRoleId;

    /**
     * 会员角色名称
     */
    @Column(columnDefinition = "varchar(60)")
    private String memberRoleName;
}
